<div>
Sets one or more environment variables within a block.
The names of environment variables are case-insensitive but case-preserving, that is, setting `Foo` will change the value of `FOO` if it already exists.
Environment variables are available to any external processes spawned within that scope.
For example:
<p><pre>
node {
  withEnv(['MYTOOL_HOME=/usr/local/mytool']) {
    sh '$MYTOOL_HOME/bin/start'
  }
}
</pre>
<p>(Note that here we are using single quotes in Groovy, so the variable expansion is being done by the Bourne shell, not Jenkins.)
<p>See the documentation for the <code>env</code> singleton for more information on environment variables.
</div>
